Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #2410 - Unlinked References doesnt work if the org-roam-directory has a space in it. #2411

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

vikram-mandyam
Copy link
Contributor

@vikram-mandyam vikram-mandyam commented Feb 1, 2024

Fix Issue #2410
In the function org-roam-unlinked-references-section the org-roam-directory variable is concated to form the rg_command. This doesn't cover any spaces in the org-roam-directory path.
So if the path is /Users/user123/MyDrive/My Files/org-mode/org-roam, due to the space in My Files rg returns an error:

rg: /Users/user123/MyDrive/My: No such file or directory (os error 2)
rg: Files/org-mode/org-roam: No such file or directory (os error 2)

This is due to the lines here:

(rg-command (concat "rg -L -o --vimgrep -P -i "
                               (mapconcat (lambda (glob) (concat "-g " glob))
                                          (org-roam--list-files-search-globs org-roam-file-extensions)
                                          " ")
                               (format " '\\[([^[]]++|(?R))*\\]%s' "
                                       (mapconcat (lambda (title)
                                                    (format "|(\\b%s\\b)" (shell-quote-argument title)))
                                                  titles ""))
                               org-roam-directory))

@Delapouite Delapouite added the 2. buffer Issues relating to Org-roam buffer label Jul 2, 2024
@Delapouite Delapouite merged commit edccf9b into org-roam:main Jul 3, 2024
@Delapouite
Copy link
Contributor

Thanks!

I added follow-up commits in #2449 so that the output of the problematic rg command can be tested and tweaked by the end user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. buffer Issues relating to Org-roam buffer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unlinked References doesnt work if the org-roam-directory has a space in it.
2 participants